.class public Lcom/hyphenate/chat/EMChatManager;
.super Ljava/lang/Object;


# static fields
.field private static final INTERNAL_ACTION_PREFIX:Ljava/lang/String; = "em_"

.field private static final TAG:Ljava/lang/String; = "EMChatManager"


# instance fields
.field caches:Ljava/util/Map;

.field chatManagerListenerImpl:Lcom/hyphenate/chat/adapter/EMAChatManagerListener;

.field private conversationListeners:Ljava/util/List;

.field emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

.field mClient:Lcom/hyphenate/chat/EMClient;

.field private messageListeners:Ljava/util/List;


# direct methods
.method protected constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/Hashtable;

    invoke-direct {v0}, Ljava/util/Hashtable;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    new-instance v0, Lcom/hyphenate/chat/EMChatManager$1;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMChatManager$1;-><init>(Lcom/hyphenate/chat/EMChatManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->chatManagerListenerImpl:Lcom/hyphenate/chat/adapter/EMAChatManagerListener;

    return-void
.end method

.method protected constructor <init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAChatManager;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/Hashtable;

    invoke-direct {v0}, Ljava/util/Hashtable;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    new-instance v0, Lcom/hyphenate/chat/EMChatManager$1;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMChatManager$1;-><init>(Lcom/hyphenate/chat/EMChatManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->chatManagerListenerImpl:Lcom/hyphenate/chat/adapter/EMAChatManagerListener;

    iput-object p1, p0, Lcom/hyphenate/chat/EMChatManager;->mClient:Lcom/hyphenate/chat/EMClient;

    iput-object p2, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager;->chatManagerListenerImpl:Lcom/hyphenate/chat/adapter/EMAChatManagerListener;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatManager;->addListener(Lcom/hyphenate/chat/adapter/EMAChatManagerListener;)V

    return-void
.end method

.method static synthetic access$000(Lcom/hyphenate/chat/EMChatManager;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$100(Lcom/hyphenate/chat/EMChatManager;Ljava/lang/String;)Z
    .locals 1

    invoke-direct {p0, p1}, Lcom/hyphenate/chat/EMChatManager;->isAdvanceDebugMessage(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method static synthetic access$200(Lcom/hyphenate/chat/EMChatManager;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$300(Lcom/hyphenate/chat/EMChatManager;Lcom/hyphenate/chat/EMMessage;Lcom/hyphenate/chat/EMConversation;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    invoke-direct {p0, p1, p2, p3, p4}, Lcom/hyphenate/chat/EMChatManager;->setMessageSendCallback(Lcom/hyphenate/chat/EMMessage;Lcom/hyphenate/chat/EMConversation;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method private isAdvanceDebugMessage(Ljava/lang/String;)Z
    .locals 1

    const-string/jumbo v0, "em_"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    :try_start_0
    invoke-static {p1}, Lcom/hyphenate/chat/a/a$a;->valueOf(Ljava/lang/String;)Lcom/hyphenate/chat/a/a$a;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private setMessageSendCallback(Lcom/hyphenate/chat/EMMessage;Lcom/hyphenate/chat/EMConversation;Ljava/lang/String;Ljava/lang/String;)V
    .locals 6

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lcom/hyphenate/chat/EMChatManager$3;

    move-object v1, p0

    move-object v2, p2

    move-object v3, p3

    move-object v4, p1

    move-object v5, p4

    invoke-direct/range {v0 .. v5}, Lcom/hyphenate/chat/EMChatManager$3;-><init>(Lcom/hyphenate/chat/EMChatManager;Lcom/hyphenate/chat/EMConversation;Ljava/lang/String;Lcom/hyphenate/chat/EMMessage;Ljava/lang/String;)V

    invoke-virtual {p1, v0}, Lcom/hyphenate/chat/EMMessage;->setInnerCallback(Lcom/hyphenate/EMCallBack;)V

    goto :goto_0
.end method


# virtual methods
.method public ackMessageRead(Ljava/lang/String;Ljava/lang/String;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/b;->b()Lcom/hyphenate/chat/EMOptions;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMOptions;->getRequireAck()Z

    move-result v0

    if-nez v0, :cond_1

    const-string/jumbo v0, "EMChatManager"

    const-string/jumbo v1, "chat option reqire ack set to false. skip send out ask msg read"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0, p2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->getMessage(Ljava/lang/String;)Lcom/hyphenate/chat/adapter/message/EMAMessage;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->sendReadAckForMessage(Lcom/hyphenate/chat/adapter/message/EMAMessage;)V

    goto :goto_0
.end method

.method public addConversationListener(Lcom/hyphenate/EMConversationListener;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method

.method public addMessageListener(Lcom/hyphenate/EMMessageListener;)V
    .locals 1

    if-nez p1, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method public deleteConversation(Ljava/lang/String;Z)Z
    .locals 1

    invoke-virtual {p0, p1}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;)Lcom/hyphenate/chat/EMConversation;

    move-result-object v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    if-nez p2, :cond_1

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMConversation;->clear()V

    :goto_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0, p1, p2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->removeConversation(Ljava/lang/String;Z)V

    const/4 v0, 0x1

    goto :goto_0

    :cond_1
    invoke-virtual {v0}, Lcom/hyphenate/chat/EMConversation;->clearAllMessages()V

    goto :goto_1
.end method

.method public downloadAttachment(Lcom/hyphenate/chat/EMMessage;)V
    .locals 2

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    iget-object v1, p1, Lcom/hyphenate/chat/EMMessage;->emaObject:Lcom/hyphenate/chat/adapter/message/EMAMessage;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatManager;->downloadMessageAttachments(Lcom/hyphenate/chat/adapter/message/EMAMessage;)V

    goto :goto_0
.end method

.method public downloadFile(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/cloud/EMHttpClient;->getInstance()Lcom/hyphenate/cloud/EMHttpClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMChatManager$4;

    invoke-direct {v1, p0, p4}, Lcom/hyphenate/chat/EMChatManager$4;-><init>(Lcom/hyphenate/chat/EMChatManager;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, p1, p2, p3, v1}, Lcom/hyphenate/cloud/EMHttpClient;->downloadFile(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/hyphenate/cloud/EMCloudOperationCallback;)V

    return-void
.end method

.method public downloadThumbnail(Lcom/hyphenate/chat/EMMessage;)V
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    iget-object v1, p1, Lcom/hyphenate/chat/EMMessage;->emaObject:Lcom/hyphenate/chat/adapter/message/EMAMessage;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatManager;->downloadMessageThumbnail(Lcom/hyphenate/chat/adapter/message/EMAMessage;)V

    return-void
.end method

.method public getAllConversations()Ljava/util/Map;
    .locals 6

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->getConversations()Ljava/util/List;

    move-result-object v0

    new-instance v1, Ljava/util/Hashtable;

    invoke-direct {v1}, Ljava/util/Hashtable;-><init>()V

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/adapter/EMAConversation;

    const-string/jumbo v3, "EMChatManager"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "convID: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAConversation;->conversationId()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAConversation;->conversationId()Ljava/lang/String;

    move-result-object v3

    new-instance v4, Lcom/hyphenate/chat/EMConversation;

    invoke-direct {v4, v0}, Lcom/hyphenate/chat/EMConversation;-><init>(Lcom/hyphenate/chat/adapter/EMAConversation;)V

    invoke-virtual {v1, v3, v4}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v3, Lcom/hyphenate/chat/EMConversation;

    invoke-direct {v3, v0}, Lcom/hyphenate/chat/EMConversation;-><init>(Lcom/hyphenate/chat/adapter/EMAConversation;)V

    invoke-virtual {v3}, Lcom/hyphenate/chat/EMConversation;->getLastMessage()Lcom/hyphenate/chat/EMMessage;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v3, v0, Lcom/hyphenate/chat/EMMessage;->emaObject:Lcom/hyphenate/chat/adapter/message/EMAMessage;

    invoke-virtual {v3}, Lcom/hyphenate/chat/adapter/message/EMAMessage;->bodies()Ljava/util/List;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_0

    const-string/jumbo v3, "EMChatManager"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "body:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v0, v0, Lcom/hyphenate/chat/EMMessage;->emaObject:Lcom/hyphenate/chat/adapter/message/EMAMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/message/EMAMessage;->bodies()Ljava/util/List;

    move-result-object v0

    const/4 v5, 0x0

    invoke-interface {v0, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/adapter/message/EMAMessageBody;

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v3, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    :cond_1
    return-object v1
.end method

.method public getConversation(Ljava/lang/String;)Lcom/hyphenate/chat/EMConversation;
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHAT:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    invoke-virtual {v0, p1, v1, v2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->GROUPCHAT:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    invoke-virtual {v0, p1, v1, v2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v0

    :cond_0
    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHATROOM:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    invoke-virtual {v0, p1, v1, v2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v0

    :cond_1
    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->DISCUSSIONGROUP:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    invoke-virtual {v0, p1, v1, v2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v0

    :cond_2
    if-nez v0, :cond_4

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->HELPDESK:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    invoke-virtual {v0, p1, v1, v2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v0

    move-object v1, v0

    :goto_0
    if-nez v1, :cond_3

    const/4 v0, 0x0

    :goto_1
    return-object v0

    :cond_3
    new-instance v0, Lcom/hyphenate/chat/EMConversation;

    invoke-direct {v0, v1}, Lcom/hyphenate/chat/EMConversation;-><init>(Lcom/hyphenate/chat/adapter/EMAConversation;)V

    goto :goto_1

    :cond_4
    move-object v1, v0

    goto :goto_0
.end method

.method public getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;)Lcom/hyphenate/chat/EMConversation;
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, v0}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;

    move-result-object v0

    return-object v0
.end method

.method public getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;
    .locals 4

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHAT:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    sget-object v1, Lcom/hyphenate/chat/EMConversation$EMConversationType;->Chat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne p2, v1, :cond_1

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHAT:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    :cond_0
    :goto_0
    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v1, p1, v0, p3}, Lcom/hyphenate/chat/adapter/EMAChatManager;->conversationWithType(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;Z)Lcom/hyphenate/chat/adapter/EMAConversation;

    move-result-object v1

    if-nez v1, :cond_5

    const/4 v0, 0x0

    :goto_1
    return-object v0

    :cond_1
    sget-object v1, Lcom/hyphenate/chat/EMConversation$EMConversationType;->GroupChat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne p2, v1, :cond_2

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->GROUPCHAT:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    goto :goto_0

    :cond_2
    sget-object v1, Lcom/hyphenate/chat/EMConversation$EMConversationType;->ChatRoom:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne p2, v1, :cond_3

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHATROOM:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    goto :goto_0

    :cond_3
    sget-object v1, Lcom/hyphenate/chat/EMConversation$EMConversationType;->DiscussionGroup:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne p2, v1, :cond_4

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->DISCUSSIONGROUP:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    goto :goto_0

    :cond_4
    sget-object v1, Lcom/hyphenate/chat/EMConversation$EMConversationType;->HelpDesk:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne p2, v1, :cond_0

    sget-object v0, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->HELPDESK:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    goto :goto_0

    :cond_5
    const-string/jumbo v0, "EMChatManager"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "convID:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAConversation;->conversationId()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    new-instance v0, Lcom/hyphenate/chat/EMConversation;

    invoke-direct {v0, v1}, Lcom/hyphenate/chat/EMConversation;-><init>(Lcom/hyphenate/chat/adapter/EMAConversation;)V

    goto :goto_1
.end method

.method public getConversationsByType(Lcom/hyphenate/chat/EMConversation$EMConversationType;)Ljava/util/List;
    .locals 5

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->getConversations()Ljava/util/List;

    move-result-object v0

    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/adapter/EMAConversation;

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMConversation$EMConversationType;->ordinal()I

    move-result v3

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAConversation;->_getType()Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->ordinal()I

    move-result v4

    if-ne v3, v4, :cond_0

    new-instance v3, Lcom/hyphenate/chat/EMConversation;

    invoke-direct {v3, v0}, Lcom/hyphenate/chat/EMConversation;-><init>(Lcom/hyphenate/chat/adapter/EMAConversation;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_1
    return-object v1
.end method

.method public getMessage(Ljava/lang/String;)Lcom/hyphenate/chat/EMMessage;
    .locals 4

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    monitor-enter v1

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMConversation$MessageCache;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/EMConversation$MessageCache;->getMessage(Ljava/lang/String;)Lcom/hyphenate/chat/EMMessage;

    move-result-object v0

    if-eqz v0, :cond_0

    monitor-exit v1

    :cond_1
    :goto_0
    return-object v0

    :cond_2
    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAChatManager;->getMessage(Ljava/lang/String;)Lcom/hyphenate/chat/adapter/message/EMAMessage;

    move-result-object v1

    if-nez v1, :cond_3

    const/4 v0, 0x0

    goto :goto_0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0

    :cond_3
    new-instance v0, Lcom/hyphenate/chat/EMMessage;

    invoke-direct {v0, v1}, Lcom/hyphenate/chat/EMMessage;-><init>(Lcom/hyphenate/chat/adapter/message/EMAMessage;)V

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->conversationId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->getFrom()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->getChatType()Lcom/hyphenate/chat/EMMessage$ChatType;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/hyphenate/chat/EMConversation;->msgType2ConversationType(Ljava/lang/String;Lcom/hyphenate/chat/EMMessage$ChatType;)Lcom/hyphenate/chat/EMConversation$EMConversationType;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {p0, v1, v2, v3}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;

    move-result-object v1

    if-eqz v1, :cond_1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMConversation;->getCache()Lcom/hyphenate/chat/EMConversation$MessageCache;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/EMConversation$MessageCache;->addMessage(Lcom/hyphenate/chat/EMMessage;)V

    goto :goto_0
.end method

.method public getUnreadMsgsCount()I
    .locals 5

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->getConversations()Ljava/util/List;

    move-result-object v1

    const/4 v0, 0x0

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    move v1, v0

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/adapter/EMAConversation;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAConversation;->_getType()Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    move-result-object v3

    sget-object v4, Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;->CHATROOM:Lcom/hyphenate/chat/adapter/EMAConversation$EMAConversationType;

    if-eq v3, v4, :cond_1

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAConversation;->unreadMessagesCount()I

    move-result v0

    add-int/2addr v0, v1

    :goto_1
    move v1, v0

    goto :goto_0

    :cond_0
    return v1

    :cond_1
    move v0, v1

    goto :goto_1
.end method

.method public declared-synchronized importMessages(Ljava/util/List;)V
    .locals 3

    monitor-enter p0

    :try_start_0
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMMessage;

    iget-object v0, v0, Lcom/hyphenate/chat/EMMessage;->emaObject:Lcom/hyphenate/chat/adapter/message/EMAMessage;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_0
    :try_start_1
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/a/b;->c(Ljava/util/List;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    monitor-exit p0

    return-void
.end method

.method public isSilentMessage(Lcom/hyphenate/chat/EMMessage;)Z
    .locals 2

    const-string/jumbo v0, "em_ignore_notification"

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Lcom/hyphenate/chat/EMMessage;->getBooleanAttribute(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public loadAllConversations()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->loadAllConversationsFromDB()Ljava/util/List;

    return-void
.end method

.method declared-synchronized loadAllConversationsFromDB()V
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->loadAllConversationsFromDB()Ljava/util/List;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public markAllConversationsAsRead()V
    .locals 3

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->loadAllConversationsFromDB()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/adapter/EMAConversation;

    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Lcom/hyphenate/chat/adapter/EMAConversation;->markAllMessagesAsRead(Z)Z

    goto :goto_0

    :cond_0
    return-void
.end method

.method onLogout()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    return-void
.end method

.method public removeConversationListener(Lcom/hyphenate/EMConversationListener;)V
    .locals 1

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->conversationListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method public removeMessageListener(Lcom/hyphenate/EMMessageListener;)V
    .locals 1

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->messageListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method public saveMessage(Lcom/hyphenate/chat/EMMessage;)V
    .locals 4

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getChatType()Lcom/hyphenate/chat/EMMessage$ChatType;

    move-result-object v1

    sget-object v0, Lcom/hyphenate/chat/EMConversation$EMConversationType;->Chat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    sget-object v2, Lcom/hyphenate/chat/EMChatManager$5;->$SwitchMap$com$hyphenate$chat$EMMessage$ChatType:[I

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMMessage$ChatType;->ordinal()I

    move-result v1

    aget v1, v2, v1

    packed-switch v1, :pswitch_data_0

    :goto_0
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getTo()Ljava/lang/String;

    move-result-object v1

    sget-object v2, Lcom/hyphenate/chat/EMConversation$EMConversationType;->Chat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    if-ne v0, v2, :cond_0

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->direct()Lcom/hyphenate/chat/EMMessage$Direct;

    move-result-object v2

    sget-object v3, Lcom/hyphenate/chat/EMMessage$Direct;->RECEIVE:Lcom/hyphenate/chat/EMMessage$Direct;

    if-ne v2, v3, :cond_0

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getFrom()Ljava/lang/String;

    move-result-object v1

    :cond_0
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getType()Lcom/hyphenate/chat/EMMessage$Type;

    move-result-object v2

    sget-object v3, Lcom/hyphenate/chat/EMMessage$Type;->CMD:Lcom/hyphenate/chat/EMMessage$Type;

    if-ne v2, v3, :cond_1

    :goto_1
    return-void

    :pswitch_0
    sget-object v0, Lcom/hyphenate/chat/EMConversation$EMConversationType;->Chat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    goto :goto_0

    :pswitch_1
    sget-object v0, Lcom/hyphenate/chat/EMConversation$EMConversationType;->GroupChat:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    goto :goto_0

    :pswitch_2
    sget-object v0, Lcom/hyphenate/chat/EMConversation$EMConversationType;->ChatRoom:Lcom/hyphenate/chat/EMConversation$EMConversationType;

    goto :goto_0

    :cond_1
    const/4 v2, 0x1

    invoke-virtual {p0, v1, v0, v2}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/EMConversation;->appendMessage(Lcom/hyphenate/chat/EMMessage;)V

    goto :goto_1

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method public sendMessage(Lcom/hyphenate/chat/EMMessage;)V
    .locals 6

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->makeCallbackStrong()V

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getType()Lcom/hyphenate/chat/EMMessage$Type;

    move-result-object v0

    sget-object v3, Lcom/hyphenate/chat/EMMessage$Type;->CMD:Lcom/hyphenate/chat/EMMessage$Type;

    if-eq v0, v3, :cond_2

    move v0, v1

    :goto_0
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->conversationId()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getTo()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getChatType()Lcom/hyphenate/chat/EMMessage$ChatType;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/hyphenate/chat/EMConversation;->msgType2ConversationType(Ljava/lang/String;Lcom/hyphenate/chat/EMMessage$ChatType;)Lcom/hyphenate/chat/EMConversation$EMConversationType;

    move-result-object v4

    invoke-virtual {p0, v3, v4, v0}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;

    move-result-object v3

    if-eqz v3, :cond_1

    invoke-virtual {v3}, Lcom/hyphenate/chat/EMConversation;->getCache()Lcom/hyphenate/chat/EMConversation$MessageCache;

    move-result-object v0

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getMsgId()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/hyphenate/chat/EMConversation$MessageCache;->getMessage(Ljava/lang/String;)Lcom/hyphenate/chat/EMMessage;

    move-result-object v0

    if-eqz v0, :cond_3

    :goto_1
    if-nez v1, :cond_1

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    invoke-virtual {v3}, Lcom/hyphenate/chat/EMConversation;->getLastMessage()Lcom/hyphenate/chat/EMMessage;

    move-result-object v2

    if-eqz v2, :cond_0

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMMessage;->getMsgTime()J

    move-result-wide v4

    cmp-long v4, v0, v4

    if-gez v4, :cond_0

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMMessage;->getMsgTime()J

    move-result-wide v0

    :cond_0
    const-wide/16 v4, 0x1

    add-long/2addr v0, v4

    invoke-virtual {p1, v0, v1}, Lcom/hyphenate/chat/EMMessage;->setMsgTime(J)V

    invoke-virtual {v3}, Lcom/hyphenate/chat/EMConversation;->getCache()Lcom/hyphenate/chat/EMConversation$MessageCache;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/EMConversation$MessageCache;->addMessage(Lcom/hyphenate/chat/EMMessage;)V

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->mClient:Lcom/hyphenate/chat/EMClient;

    new-instance v1, Lcom/hyphenate/chat/EMChatManager$2;

    invoke-direct {v1, p0, p1, v3}, Lcom/hyphenate/chat/EMChatManager$2;-><init>(Lcom/hyphenate/chat/EMChatManager;Lcom/hyphenate/chat/EMMessage;Lcom/hyphenate/chat/EMConversation;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void

    :cond_2
    move v0, v2

    goto :goto_0

    :cond_3
    move v1, v2

    goto :goto_1
.end method

.method public setMessageListened(Lcom/hyphenate/chat/EMMessage;)V
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p1, v0}, Lcom/hyphenate/chat/EMMessage;->setListened(Z)V

    invoke-virtual {p0, p1}, Lcom/hyphenate/chat/EMChatManager;->updateMessage(Lcom/hyphenate/chat/EMMessage;)Z

    return-void
.end method

.method public updateMessage(Lcom/hyphenate/chat/EMMessage;)Z
    .locals 3

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->direct()Lcom/hyphenate/chat/EMMessage$Direct;

    move-result-object v0

    sget-object v1, Lcom/hyphenate/chat/EMMessage$Direct;->RECEIVE:Lcom/hyphenate/chat/EMMessage$Direct;

    if-ne v0, v1, :cond_0

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getFrom()Ljava/lang/String;

    move-result-object v0

    :goto_0
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getType()Lcom/hyphenate/chat/EMMessage$Type;

    move-result-object v1

    sget-object v2, Lcom/hyphenate/chat/EMMessage$Type;->CMD:Lcom/hyphenate/chat/EMMessage$Type;

    if-ne v1, v2, :cond_1

    const/4 v0, 0x0

    :goto_1
    return v0

    :cond_0
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getTo()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    :cond_1
    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->conversationId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1}, Lcom/hyphenate/chat/EMMessage;->getChatType()Lcom/hyphenate/chat/EMMessage$ChatType;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/hyphenate/chat/EMConversation;->msgType2ConversationType(Ljava/lang/String;Lcom/hyphenate/chat/EMMessage$ChatType;)Lcom/hyphenate/chat/EMConversation$EMConversationType;

    move-result-object v0

    const/4 v2, 0x1

    invoke-virtual {p0, v1, v0, v2}, Lcom/hyphenate/chat/EMChatManager;->getConversation(Ljava/lang/String;Lcom/hyphenate/chat/EMConversation$EMConversationType;Z)Lcom/hyphenate/chat/EMConversation;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/EMConversation;->updateMessage(Lcom/hyphenate/chat/EMMessage;)Z

    move-result v0

    goto :goto_1
.end method

.method public updateParticipant(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0, p1, p2}, Lcom/hyphenate/chat/adapter/EMAChatManager;->updateParticipant(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    return v0
.end method
